<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of class
 *
 * @author NTC
 */
class Message {
    //put your code here


    function add_message($author, $title, $message){
        global $db;
        $timepost = time('YYYY-mm-dd HH:mm:SS');
        $sql = "INSERT INTO contact_messages (`author`, `title`, `message`, `join_date`, `usergroups_id`, 'timepost')
                    VALUES ('".$author."', '".$title."', '".$message."', '".$timepost."' )";
        echo $sql;
        $rows= $db->query($sql, $fetchArray=true);
        if (count($rows)>0) return $rows;
        return null;
    }

    function get_all_message(){
        
    }


    
}
?>
